package com.example.demo.day0229;



import java.io.FileWriter;
import java.io.IOException;

public class DemoOutput1 {
    public static void testFileWriter(String text,String outpath){
        try {
            FileWriter fw = new FileWriter(outpath);//文件字符输出流
            fw.write(text);//ba参数写道内存中
            fw.flush();//把内存中的数据刷到硬盘
            fw.close();//关闭流
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

}
